
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Framework.Library.Utilities;
using Framework.Module.CMS.Library;
using Framework.Library.Components.Portal;
using Framework.Library;
using Framework.Library.Components;
using Framework.Library.Components.Users;
using Framework.Module.CMS.Library.Definitions;
using Framework.Library.Components.Lang;
namespace Framework.Module.CMS.Web.HomePage
{
    public partial class Language_Detail : System.Web.UI.UserControl
    {
        //protected void Page_Load(object sender, EventArgs e)
        //{
        //    DataTable dtLang = MainLanguagesController.GetAll_Without_Current_Language(AppEnv.GetLanguage());
        //    this.rpt.DataSource = dtLang;
        //    this.rpt.DataBind();
        //}

        //protected void rpt_ItemCommand(object source, RepeaterCommandEventArgs e)
        //{
        //    //if (e.CommandName == "Lang")
        //    //{
        //    ImageButton lbt = (ImageButton)this.FindControl("ImageButton1");
        //        AppEnv.SetLanguage(lbt.CommandArgument.ToString());
        //        DataCaching data = new DataCaching();
        //        data.RemoveAll();
        //        Response.Redirect(Request.RawUrl, true);
        //    //}
        //}
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (AppEnv.GetLanguage() == "vi-VN")
                {
                    lnkbtja.Visible = true;
                    lnkbtvn.Visible = false;
                    lblAfterVi.Visible = false;
                    lblAfterEN.Visible = true;
                    lnkbten.Visible = true;

                }
                else if (AppEnv.GetLanguage() == "en-US")
                {
                    lnkbtja.Visible = true;
                    lnkbten.Visible = false;
                    lblAfterVi.Visible = true;
                    lblAfterEN.Visible = false;
                    lnkbtvn.Visible = true;

                }
                else
                {
                    lnkbtja.Visible = false;
                    lnkbtvn.Visible = true;
                    lnkbten.Visible = true;
                    lblAfterVi.Visible = true;
                    lblAfterEN.Visible = false;
                }
            }
        }
        protected void LinkButton1_Click(object sender, EventArgs e)
        {

            AppEnv.SetLanguage(lnkbtvn.CommandArgument.ToString());
            DataCaching data = new DataCaching();
            data.RemoveAll();
            //Response.Redirect(Request.RawUrl, true);
            Response.Redirect("/Home/Default.aspx");
            
        }

        protected void lnkbten_Click(object sender, EventArgs e)
        {
            AppEnv.SetLanguage(lnkbten.CommandArgument.ToString());
            DataCaching data = new DataCaching();
            data.RemoveAll();
            //Response.Redirect(Request.RawUrl, true);
            Response.Redirect("/Home/Default.aspx");
        }

        protected void lnkbtja_Click(object sender, EventArgs e)
        {
            AppEnv.SetLanguage(lnkbtja.CommandArgument.ToString());
            DataCaching data = new DataCaching();
            data.RemoveAll();
            //Response.Redirect(Request.RawUrl, true);
            Response.Redirect("/Home/Default.aspx");
        }

     
    }
}